import React from 'react'
import { useLocation, useParams, useSearchParams } from 'react-router-dom'

// 它是Message的子路由组件
export default function MessageDetail() {
  // 读取state参数
  const location = useLocation()
  console.log(location)
  const {id, title, content} = location.state

  return (
    <ul>
      <li>ID: {id}</li>
      <li>TITLE: {title}</li>
      <li>CONTENT: {content}</li>
    </ul>
  )
}
